<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="description" content="小喾苦的网站" />
  <meta name="keywords" content="小喾苦, 个人网站, 小喾苦的网站" />
  <link rel="stylesheet" type="text/css" href="./main.css" />
  <title>小喾苦的网站</title>
  <script src="./footer.js"></script>
</head>

<body>
  <header class="xkk_header">
    <h1 class="xkk_h1">小喾苦的网站</h1>
  </header>
  <main class="xkk_main">
    <p class="xkk_p text-center">
      <a href="./program/">程序</a> | <a href="./search.html" target="_blank">搜索聚合</a> | <a href="./message.html">留言板</a>
      | <a href="./other/">其他</a>
      <br /><br />
      <a href="./md/?title=%E7%BD%91%E7%AB%99%E6%94%B6%E8%97%8F&md=../other/website-collection.md#begin"
        target="_blank">网站收藏</a> |
      <a href="./md/?title=%E8%BD%AF%E4%BB%B6%E6%94%B6%E8%97%8F&md=../other/software-collection.md#begin"
        target="_blank">软件收藏</a> |
      <a href="https://github.com/xkk1/xkk1data/blob/main/book/list.md#begin" target="_blank">书籍收藏</a>
      <br /><br />
      <!--<a href="http://xiaokuku.ys168.com/" target="_blank">网盘</a> <a href="http://ys168.com/" target="_blank">（永硕E盘）</a> |-->
      <a href="http://xiaokuku.ysepan.com/" target="_blank">小喾苦网盘</a> | <a
        href="http://xkk.pythonanywhere.com/chat_room.html" target="_blank">聊天室</a> |
      <!--<a href="./2021/08/07/Lucid-Dream.html" target="_blank">清明梦、清醒梦</a>-->
      <a href="./md/?md=../blog/index.md&title=小喾苦的博客" target="_blank">博客</a> | <a href="./about.html">关于</a>
    </p>
    <!-- 一言 -->
    <div id="hitokoto" class="xkk_p" style="font-size: 1rem;">
      <a href="#" id="hitokoto_link" class=" text-center" target=_blank>
        <p id="hitokoto_text"></p>
        <p id="hitokoto_information"></p>
      </a>
      <a href="javascript:;" onclick="set_hitokoto()">换一换</a>
    </div>
  </main>
  <footer class="xkk_footer">
    <p class="xkk_p">
      本站已在风雨中度过：<span id="sitetime">?年?天?小时?分钟?秒（正在加载...）</span>
    </p>
    <p class="xkk_p">
      源码:
      <a href="https://github.com/xkk1/xkk1.github.io" target="_blank">GitHub</a> |
      <a href="https://gitlab.com/xkk1/xkk1.gitlab.io" target="_blank">GitLab</a> |
      <a href="https://jihulab.com/xkk1/xkk1.pages.jihulab.net" target="_blank">JihuLab（极狐）</a> |
      <a href="https://gitee.com/xkk1/xkk1" target="_blank">Gitee（码云）</a> |
      <a href="https://gitcode.com/xkk1/xkk1" target="_blank">GitCode</a>
    </p>
  </footer>

  <style type="text/css">
    .xkk_header .xkk_h1 {
      padding: 2rem;
      font-size: 2.5rem;
    }

    .xkk_p {
      font-size: 1.25rem;
    }

    .xkk_footer .xkk_p {
      text-align: center;
      font-size: 1rem;
    }

    #hitokoto {
      display: none;
      font-size: 1.25rem;
    }

    #hitokoto_link {
      color: inherit;
      text-decoration: none;
    }
  </style>
  <script>
    /*一言*/
    function set_hitokoto() {
      fetch('https://v1.hitokoto.cn')
        .then(response => response.json())
        .then(data => {
          document.getElementById("hitokoto_link").href = `https://hitokoto.cn/?uuid=${data.uuid}`;
          document.getElementById("hitokoto_text").textContent = data.hitokoto;
          if (!data.from_who) {data.from_who = "";}
          document.getElementById("hitokoto_information").textContent = `—— ${data.from_who}「${data.from}」`;
          document.getElementById("hitokoto").style.display = "block";
        })
      .catch(console.error)
    }
    set_hitokoto();

    function siteTime() {
      window.setTimeout(siteTime, 1000);
      var seconds = 1000;
      var minutes = seconds * 60;
      var hours = minutes * 60;
      var days = hours * 24;
      var years = days * 365;
      var today = new Date();
      var todayYear = today.getFullYear();
      var todayMonth = today.getMonth() + 1;
      var todayDate = today.getDate();
      var todayHour = today.getHours();
      var todayMinute = today.getMinutes();
      var todaySecond = today.getSeconds();
      /* Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
      year - 作为date对象的年份，为4位年份值
      month - 0-11之间的整数，做为date对象的月份
      day - 1-31之间的整数，做为date对象的天数
      hours - 0(午夜24点)-23之间的整数，做为date对象的小时数
      minutes - 0-59之间的整数，做为date对象的分钟数
      seconds - 0-59之间的整数，做为date对象的秒数
      microseconds - 0-999之间的整数，做为date对象的毫秒数 */
      var t1 = Date.UTC(2020, 9, 15, 22, 7, 16); //2020-09-15 22:07:16创建网站的时间
      var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond);
      var diff = t2 - t1;
      var diffYears = Math.floor(diff / years);
      var diffDays = Math.floor((diff / days) - diffYears * 365);
      var diffHours = Math.floor((diff - (diffYears * 365 + diffDays) * days) / hours);
      var diffMinutes = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours) / minutes);
      var diffSeconds = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours - diffMinutes * minutes) / seconds);
      document.getElementById("sitetime").innerHTML = +diffYears + "年" + diffDays + "天" + diffHours + "小时" + diffMinutes + "分钟" + diffSeconds + "秒";
    }
    siteTime();
  </script>
</body>

</html>